from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired


class NameForm(FlaskForm):
    name = StringField('What is your name?', validators=[DataRequired()])
    submit = SubmitField('Submit')


# 构造查询表单类
class SearchForm(FlaskForm):
    name = StringField('术语词', validators=[DataRequired()])  # 输入文本框
    submit = SubmitField('查询')  # 提交按钮


class AddForm(FlaskForm):
    code = StringField('编码', validators=[DataRequired()])  # 编码
    ICD_code = StringField('ICD编码')  # ICCD编码
    SNO_code = StringField('SNOMED编码')  # SNOMED编码
    name = StringField('名称', validators=[DataRequired()])  # 名称
    description = StringField('备注')  # 描述
    submit = SubmitField('添加')  # 添加按钮


class EditForm(FlaskForm):
    code = StringField('编码', validators=[DataRequired()])  # 编码
    ICD_code = StringField('ICD编码')  # ICCD编码
    SNO_code = StringField('SNOMED编码')  # SNOMED编码
    name = StringField('名称', validators=[DataRequired()])  # 名称
    description = StringField('备注')  # 描述
    submit = SubmitField('修改')  # 添加按钮


class DeleteWordForm(FlaskForm):
    id = StringField()
